package com.aaa.fpa.controller;

import com.aaa.pojo.MyReturn;
import com.aaa.pojo.PageSort;
import com.aaa.fpa.service.LogService;
import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/log")
public class LogController {
    @Autowired
    private LogService logService;
    MyReturn myReturn=new MyReturn();

    @RequestMapping("/toShowLog.do")
    public String toShowLog() {
        return "/showLog";
    }

    @RequestMapping("/findAllLog.do")
    @ResponseBody
    public MyReturn findAllLog(PageSort pageSort) {
        Page page = logService.findAll(pageSort);
        myReturn.setData(page);
        myReturn.setCount(page.getTotal());
        return myReturn;
    }
}
